<template>
  <div>
    <h2>热卖商品</h2>
    <div>
       <ul>
         <li v-for="(item,index) in hotProductList" :key="index" @click="go(item.pid)">{{item.title}}</li>
       </ul>
    </div>
  </div>
</template>

<script lang='ts' setup>
import {ref} from 'vue'
import {useRouter} from 'vue-router'
const router=useRouter()
const hotProductList=ref([
  {
    pid:'1001',
    title:'雅诗兰黛',
    price:200
  },
  {
    pid:'1002',
    title:'兰蔻香水',
    price:1200
  },
  {
    pid:'1003',
    title:'吴尊男士洗面奶',
    price:500
  }
])
const go=(arg:string)=>{
  router.push(`/product/hotProductDetail/${arg}`)
  
}
</script>

<style lang='scss' scoped>
</style>